package com.jojo.controller;

import com.jojo.component.FfmpegComponent;
import com.jojo.domain.JsonVO;
import com.jojo.service.VideoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/video")
@Api("视频流接口")
public class VideoController {

    @Autowired
    VideoService service;

    @GetMapping("/stream/push")
    @ApiOperation("推流")
    public JsonVO<String> pushFlow(){
        service.pushStream();
        return JsonVO.success("开始推流");
    }

    @ApiOperation("停止推流")
    @GetMapping("/stream/stop")
    public JsonVO<String> stopFlow(){
        service.stopStream();
        return JsonVO.success("停止推流");
    }
}
